package com.gxa.saas.service.impl;

import com.gxa.saas.mapper.StoreHouseInMapper;
import com.gxa.saas.pojo.GoodsXq;
import com.gxa.saas.pojo.Storage;
import com.gxa.saas.pojo.StoreHouseIn;
import com.gxa.saas.service.StoreHouseInService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class StoreHouseInServiceImpl implements StoreHouseInService {

    @Autowired
    StoreHouseInMapper storeHouseInMapper;

    @Override
    public List<StoreHouseIn> selectByPage(Integer limit, Integer size) {
        List<StoreHouseIn> storeHouseIns=storeHouseInMapper.selectByPage((limit-1)*size,size);
        return storeHouseIns;
    }

    @Override
    public Integer addInList(StoreHouseIn storeHouseIn) {

        return storeHouseInMapper.addInList(storeHouseIn);
    }


    @Override
    public Integer deleteById(Integer id) {

        return storeHouseInMapper.deleteById(id);
    }

    @Override
    public StoreHouseIn selectById(Integer id) {
        return storeHouseInMapper.selectById(id);
    }

    @Override
    public Integer update(Map map) {
        return storeHouseInMapper.update(map);
    }

    @Override
    public Integer updateCheck(Integer id, String comments) {
        return storeHouseInMapper.updateCheck(id,comments);
    }

    @Override
    public StoreHouseIn selectByStateAndId(Integer id, String state) {
        StoreHouseIn storeHouseIn = storeHouseInMapper.selectByStateAndId(id, state);
        return storeHouseIn;
    }

    @Override
    public List<StoreHouseIn> selectAll() {
        List<StoreHouseIn> storeHouseIns = storeHouseInMapper.selectAll();
        return storeHouseIns;
    }


    @Override
    public List<StoreHouseIn> selectByDateAndVendorAndDepotAndState(Map map) {
        return storeHouseInMapper.selectByDateAndVendorAndDepotAndState(map);
    }

    @Override
    public List<Storage> getStorageList(Integer limit, Integer size) {
        return storeHouseInMapper.selectStorageByPage((limit-1)*size, size);
    }

    @Override
    public Integer getTotalCountIn() {
        return storeHouseInMapper.selectTotalMount();
    }

    @Override
    public Integer getTotalStorageIn() {
        return storeHouseInMapper.selectTotalStorage();
    }

    @Override
    public Integer getTotalByLike(String name) {
        return storeHouseInMapper.selectTotalByLike(name);
    }

    @Override
    public Integer getTotalByTiaojian(Map map) {
        return storeHouseInMapper.selectTotalByTiaojian(map);
    }
    @Override
    public List<StoreHouseIn> getDropDownList() {
        return storeHouseInMapper.getDropDownList();
    }
    @Override
    public List<Storage> selectStoreDetail(String goodsName, Integer page, Integer size) {
        return storeHouseInMapper.selectStoreDetail(goodsName, (page-1)*size, size);
    }
    @Override
    public List<GoodsXq> selectDetailById(Integer id) {
        List<GoodsXq> goodsXqs = storeHouseInMapper.selectDetailById(id);
        return goodsXqs;
    }
    @Override
    public Storage selectByDetailId(Integer id) {
        return storeHouseInMapper.selectByDetailId(id);
    }
    @Override
    public Integer deleteDetailById(Integer id) {
        return storeHouseInMapper.deleteDetailById(id);
    }

    @Override
    public Integer updateByPrice(Integer bigCount, Integer smallCount, Double money, Integer id) {
        return storeHouseInMapper.updateByPrice(bigCount, smallCount, money, id);
    }
    @Override
    public Integer insertGoodsXq(GoodsXq goodsXq) {
        return storeHouseInMapper.insertGoodsXq(goodsXq);
    }

    @Override
    public GoodsXq selectByGoodsXqId(Integer id) {
        return storeHouseInMapper.selectByGoodsXqId(id);
    }
}
